package cn.scau.server.controller;


import cn.scau.server.pojo.EmpPos;
import cn.scau.server.service.EmpPosService;
import cn.scau.server.vo.ResultVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 代码不跑我先跑
 * @since 2025-03-30
 */
@RestController
@RequestMapping("/emp-pos")
public class EmpPosController {

    @Autowired
    private EmpPosService empPosService;

    @PostMapping("/addEmpPos")
    @ApiOperation("新增部门信息")
    public ResultVO addEmpPos(EmpPos empPos){
        empPos.setIsLeader(0);
        empPosService.save(empPos);
        return ResultVO.success("新增成功");
    }

    //修改员工职位信息
    @PostMapping("/updateEmpPosition")
    @ApiOperation("修改员工职位信息")
    public ResultVO updateEmpPosition(String empId, String deptName, String positionName, Integer isLeader){
        return empPosService.updateEmpPosition(empId,deptName,positionName,isLeader);
    }

}
